<ui:composition template="/WEB-INF/templates/main-template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" >
	
	<ui:param name="pageName" value="#{msg['employeeeform.pagename']}" />
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml"/>
	</ui:define>
	<ui:define name="content">
		
		<h:outputText value="Create Vendor" styleClass="outputTextTitle"/>	
		<h:form> 
		 <p:growl></p:growl>
		 
		 <p:panel header="Register Vendors Form"> 
		   <h:panelGrid columns="4" style="border:0;" cellspacing="8">
		          
           <h:outputLabel value="" style="color : red;" />
           <h:outputLabel value="Vendor Code" />
           <h:outputLabel value=":" />
           <h:outputText value="#{createVendorRegistrationBean.recruitmentVendor.vendorCode}" />
          
           <h:outputLabel value="" style="color : red;" />
           <h:outputLabel value="Date of Registration" />
           <h:outputLabel value=":" />
           <h:outputText value="#{createVendorRegistrationBean.recruitmentVendor.createDate}" >
           		<f:convertDateTime  pattern="dd-MMM-yyyy HH:mm a"/>
           </h:outputText>
		              
           <h:outputLabel value="" style="color : red;" />
           <h:outputLabel value="Registered By" />
           <h:outputLabel value=":" />
           <h:outputText value="#{createVendorRegistrationBean.recruitmentVendor.employee.firstName} #{createVendorRegistrationBean.recruitmentVendor.employee.lastName}" />
          
           <h:outputLabel value="*" style="color : red;" />
           <h:outputLabel value="Vendor Name " />
           <h:outputLabel value=":" />
           <p:inputText value="#{createVendorRegistrationBean.recruitmentVendor.vendorName}"  />
           
           <h:outputLabel value="*" style="color : red;" />
           <h:outputLabel value="Vendor E-Mail" />
           <h:outputLabel value=":" />
           <p:inputText value="#{createVendorRegistrationBean.recruitmentVendor.vendorEmail}"  />
           
           <h:outputLabel value="*" style="color : red;" />
           <h:outputLabel value="Vendor Contact Number" />
           <h:outputLabel value=":" />
           <p:inputMask value="#{createVendorRegistrationBean.recruitmentVendor.vendorContactNumber}" mask="(999) 999-9999"  />
           
           <h:outputLabel value="*" style="color : red;" />
           <h:outputLabel value="Vendor Contact Person" />
           <h:outputLabel value=":" />
           <p:inputText value="#{createVendorRegistrationBean.recruitmentVendor.vendorContactPerson}"   />
           
           <h:outputLabel value="*" style="color : red;" />
           <h:outputLabel value="Vendor Address" />
           <h:outputLabel value=":" />
           <p:inputTextarea value="#{createVendorRegistrationBean.recruitmentVendor.vendorAddress}"  autoResize="false" cols="17" />
           
           <h:inputHidden />
           <h:outputLabel value="Remarks" />
           <h:outputLabel value=":" />
           <p:inputTextarea value="#{createVendorRegistrationBean.recruitmentVendor.remarks}"  autoResize="false" cols="17" />
           
          </h:panelGrid>
          
        <h:panelGrid style="padding-top: 5px; width: 100%; border-top: 1px solid #d9d9d9"
						columnClasses="gridCellMiddleRightAligned">
			  <h:panelGroup>
		           <p:commandButton id="submit" value="Submit" update="@form" actionListener="#{createVendorRegistrationBean.confirmVendorRequest}" />
		           <p:commandButton value="Reset" action="createvendorregistration" /> 
		           <p:commandButton value="Home" action="wudashboard" /> 		           
	          </h:panelGroup>
		</h:panelGrid>
          
 	    </p:panel>
 	    
 	    <p:confirmDialog widgetVar="confirmation" id="confirmation" severity="alert" message="This will submit your new vendor. Proceed?">
				<h:panelGroup style="text-align: right; float: right;">
					<p:commandButton value="Yes, Submit Now" action="#{createVendorRegistrationBean.saveVendorRequest}" update="@form" oncomplete="confirmation.hide()"/>
					<p:commandButton id="decline" value="Not Yet" onclick="confirmation.hide()" type="button" />
				</h:panelGroup>
	    </p:confirmDialog>
     
     </h:form>
	</ui:define>
	
</ui:composition>
